﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class WebForm_ManageUser_ManageUser : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //((Literal)this.Page.Master.FindControl("Literal1")).Text = this.GetLocalResourceObject("ManageUser").ToString();
            Label lblHeadText = (Label)this.Page.Master.FindControl("lblHeadText");
            if (lblHeadText != null)
            {
                lblHeadText.Text = this.GetLocalResourceObject("ManageUser").ToString();
            }
            this.InitData();        
        }

    }

    //新增模式
    protected void lbtnAdd_Click(object sender, EventArgs e)
    {
        this.TabContainer1.ActiveTab = this.EditUserTabPanel;
        this.EditUserTabPanel.HeaderText = this.GetLocalResourceObject("AddUser").ToString();
        this.ucEditUser1.InitData("0"); 
    }

    //編輯模式
    protected void GoEdit(object sender, EventArgs e)
    {
        this.TabContainer1.ActiveTab = this.EditUserTabPanel;
        this.EditUserTabPanel.HeaderText = this.GetLocalResourceObject("EditUser").ToString();
        this.ucEditUser1.InitData(this.ucQueryUser1.SelectedID); 
    }

    //刪除
    protected void GoDelete(object sender, EventArgs e)
    {
        this.ucEditUser1.InitData("0"); 
    }

    //編輯存檔後
    protected void GoSaved(object sender, EventArgs e)
    {
        this.TabContainer1.ActiveTab = this.QueryUserTabPanel;
        this.EditUserTabPanel.HeaderText = this.GetLocalResourceObject("AddUser").ToString();
        this.ucQueryUser1.InitData();
        this.ucEditUser1.InitData("0");
    }


    protected void lknAddProperty_Click(object sender, EventArgs e)
    {
        this.mvProperty.SetActiveView(this.vwAddProperty);
        this.AddProperty1.BindFVForInsert();
        this.TabContainer1.ActiveTab = this.PropertyTabPanel;
    }

    protected void lknSearchProperty_Click(object sender, EventArgs e)
    {
        this.mvProperty.SetActiveView(this.vwSearchProperty);
        this.TabContainer1.ActiveTab = this.PropertyTabPanel;
    }

    protected void SearchProperty1_Editing(object sender, EventArgs e)
    {
        this.mvProperty.SetActiveView(this.vwAddProperty);
        this.AddProperty1.Value = this.SearchProperty1.EditKey["Value"].ToString();
        this.AddProperty1.BindFVForEdit(); ;
    }

    protected void AddProperty1_Saved(object sender, EventArgs e)
    {
        this.mvProperty.SetActiveView(this.vwSearchProperty);
        this.SearchProperty1.BindGV();
    }
}


public partial class WebForm_ManageUser_ManageUser
{

    private void InitData()
    {
        this.ucQueryUser1.InitData();
        this.ucEditUser1.InitData("0");     
    }





}
